<?php
namespace app\scodetrace\model;

class Activity extends \app\common\model\Base{
	protected $table='xl_activity';
	// protected $visible=['name'];

	protected $append=['type_name','submitter'];
	protected $insert=['submitter_id','submitter_time'];
	protected $_RejectCreate = ['submitter_time','submitter'];
  protected $_RejectUpdate = ['submitter_time','submitter'];
	use \app\common\model\BaseSubmitter;

	protected function getTypeNameAttr(){
		return $this->activity_type()->value('name');
	}

	public function batch(){
		return $this->belongsTo("Batch",'batch_id');
	}

	public function activity_type() {
		return $this->belongsTo("ActivityType",'type_id');
	}
}
?>